import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { JstAllotEnterOrderVO, JstAllotEnterOrderForm, JstAllotEnterOrderQuery } from '@/api/jdAndJstSceneClassification/allot/jstAllotEnterOrder/types';

/**
 * 查询聚水潭-调拨入单列表
 * @param query
 * @returns {*}
 */

export const listJstAllotEnterOrder = (query?: JstAllotEnterOrderQuery): AxiosPromise<JstAllotEnterOrderVO[]> => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-调拨入单详细
 * @param id
 */
export const getJstAllotEnterOrder = (id: string | number): AxiosPromise<JstAllotEnterOrderVO> => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭-调拨入单
 * @param data
 */
export const addJstAllotEnterOrder = (data: JstAllotEnterOrderForm) => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭-调拨入单
 * @param data
 */
export const updateJstAllotEnterOrder = (data: JstAllotEnterOrderForm) => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭-调拨入单
 * @param id
 */
export const delJstAllotEnterOrder = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder/' + id,
    method: 'delete'
  });
};
